package com.tianji.learning.utils;

import com.tianji.learning.service.ILearningLessonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @author LYQ
 */
@Slf4j
@Component
public class CourseExpirationChenckTask {


    @Autowired
    private ILearningLessonService learningLessonService;

    /**
     * 用户课程过期修改
     * 每天0点执行一次
     */
    @Scheduled(cron = "0 0 0 * * ? ")
    public void updateReservationStatus() {
        log.info("课程状态-过期修改-begin");
        learningLessonService.updateLearningLessonStatus();
        log.info("预约状态-过期修改-end");
    }
}

